Migration Guide for Embeddings
To maintain backward compatibility with existing integrations:
-
Explicitly specify v1 version in your requests:
{
"version": "context.api/v1",
"objectKeys": ["path/to/document.pdf"],
"actions": ["text-embeddings"]
} -
Update code to handle flat format when migrating to v2:
// v1 code
const embedding = response.textEmbeddings.result[0]; // Get first array
// v2 code
const embedding = response.textEmbeddings.result; // Direct access -
Test thoroughly before switching to v2 to ensure compatibility with your embedding storage and similarity search systems.
For detailed information on migrating your Context API integration from v1 to v2, see Migration Guide: v1 to v2